package test;

import UserInfo.WechatUser;
import send.WechatSend;
import token.getAccessToken;

public class Main {
    public static void main(String[] args) {
        try {
            // Step 1: 获取Access Token
            getAccessToken WeChatToken = new getAccessToken();
            String accessToken = WeChatToken.getAccessToken();
            System.out.println("Access Token: " + accessToken);

            // Step 2: 获取用户信息

            WechatUser WeChatUser = new WechatUser();
            String userInfo = WeChatUser.WechatUser("zhuwanyi", accessToken);
            System.out.println("User Info: " + userInfo);

            // Step 3: 发送消息
            send.WechatSend WeChatMessage = new WechatSend();
            WeChatMessage.WechatSend(accessToken, "你要打扫的房间"+"${706}"+
                    "点击登录查看"+
                    "https://developer.work.weixin.qq.com/tutorial/detail/53");
            System.out.println("Message sent successfully!");

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}